package com.zerocarbon.framework.common.constants;

/**
 * 上下文常量工具类
 * @author wyf  2020年5月30日
 */
public class ContextConstants {
	
    public static final String USER_SPLIT = ":";						//用户信息分隔符
    
    //JWT
    public static final String JWT_KEY_ACCOUNT_ID = "accountId";		//JWT中封装的 用户id
    public static final String JWT_KEY_USER_ID = "userId";				//JWT中封装的 用户id
    public static final String JWT_KEY_USER_IDENTITY = "userIdentity";	//JWT中封装的 用户身份
    public static final String JWT_KEY_USER_NAME = "userName";			//JWT中封装的 用户名称
    public static final String JWT_KEY_USER_MOBILE = "userMobile";		//JWT中封装的 用户手机号
    public static final String JWT_KEY_COMPANY_ID = "companyId";		//JWT中封装的 机构id
    public static final String JWT_KEY_COMPANY_NAME = "companyName";	//JWT中封装的 机构名
    public static final String JWT_KEY_ROLES = "roleIds";	//JWT中封装的 机构名
    public static final String JWT_KEY_PERMS = "permIds";	//JWT中封装的 机构名
    public static final String JWT_KEY_TENANT_ID = "tenantId";				//JWT中封装的 租户编码

    public static final String JWT_KEY_TOKEN_TYPE = "tokenType";		//JWT中封装的 token类型
    public static final String JWT_KEY_HEADER_PREFIX = "headerPrefix";  //JWT中封装的 认证请求头前缀

    public static final String JWT_SIGN_KEY = "AACCBB1122diicssxxii";	//JWT token 签名  HS256
    public static final String JWT_KEY_TOKEN = "token";					//JWT token 参数名
    public static final String JWT_PUBLIC_KEY = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCSYt1oa8jKQm+wd5lzdntpgKNkYUPDiWxFoFJzRogFAqo4zAUlyjWOUo"
    		+ "fa+LQa1NuSupPQUXw68XQwp3otn3eEh4AR0fnCODSg3ndTO2XEgaRwa1cagApb07PLjmyquexfQnQNRJX9nmVzLQksD9cKBF7IxMQX0wn6T2P/cCireQIDAQAB";						//JWT token 公钥 RS256
    public static final String JWT_PRIVATE_KEY = "MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAJJi3WhryMpCb7B3mXN2e2mAo2RhQ8OJbEWgUnNGi"
    		+ "AUCqjjMBSXKNY5Sh9r4tBrU25K6k9BRfDrxdDCnei2fd4SHgBHR+cI4NKDed1M7ZcSBpHBrVxqAClvTs8uObKq57F9CdA1Elf2eZXMtCSwP1woEXsjExBfTCfpP"
    		+ "Y/9wKKt5AgMBAAECgYAPqh6xPt90rVlQU+wKzAH2zzos0q+yq/D3HmnURhbmGlvmygY+/f1vJmu9ReHYATEh6W9J2n5lvFLHphRP74GVdmKYEq4mhjSVaEquTH8q"
    		+ "H0DMCF4mzazPpX5TQGB3GR2NdqOvyHPAs6XfClmSzs9XtgcqQ/hZPk9ZoG30YOeJdQJBANRjiyiQFtJt/2i/Nc4x8Z8GfxF75C/h6cFmFrCFpecb/evF7RbBGRq"
    		+ "JlfRK2Azm3JlfqrrBAnHaKWd6QjhlkOsCQQCwcdF79SR3lfLwxQ1bxfY0m2nhRy8EysP5e2salPD7Fxpnr3X+d4K+Y8dPt+XUWqO2dD8t8hn91raFlmiI1vwrAk"
    		+ "B0b9JFvaDVYnqImXNNBLJ7RVt6YVp7KbY2UdqUkeCfMAhoLs1JETnLA6zTDgkeIZ7E8t6tnczSUBEs6qjNNFlbAkBH0Rv1+1KrhhILI/mK+Cl9QiC3fBTMO4fG3R"
    		+ "A8EpF/cejieQ1q1NQXkF9IuE5Iv9fQ5MHufpNLuYAzIYRM5kxfAkEAmyswvNzSG3UQPRwkzms/OrujR+eKjWgTfrArLhhqf3ya4456OYwwALt07azlwia21UR"
    		+ "3i4DhRy+bT/Qy1g3seQ==";					//JWT token 私钥 RS256
    
    //TOKEN
  	public final static String BEARER_HEADER_KEY = "Authorization";			//User信息 认证请求头
  	public static final String BEARER_HEADER_PREFIX = "Bearer ";			//User信息 认证请求头前缀
    public static final String BEARER_HEADER_PREFIX_EXT = "Bearer%20";		//User信息 认证请求头前缀
    
    public final static String ACCESS_TOKEN = "access_token";				//认证token
  	public final static String REFRESH_TOKEN = "refresh_token";				//刷新token
  	
  	/*public static final String BASIC_HEADER_KEY = "Authorization";		//Client信息认证请求头
    public static final String BASIC_HEADER_PREFIX = "Basic ";				//Client信息认证请求头前缀
    public static final String BASIC_HEADER_PREFIX_EXT = "Basic%20";		//Client信息认证请求头前缀
  	*/  	
    public static final Integer ACCESS_TOKEN_VALIDITY_SECONDS = 60 * 60;    //默认token过期时间(1小时)
    
    //日志
    public static final String TRACE_ID_HEADER = "x-traceid-header";		//日志链路追踪id信息头
    public static final String LOG_TRACE_ID = "traceId";					//日志链路追踪id日志标志
    
    //user header
    public static final String USER_NAME_HEADER = "x-username-header";		//用户信息头
    public static final String USER_ID_HEADER = "x-userid-header";			//用户id信息头
    public static final String COMPANY_ID_HEADER = "x-companyid-header";			//机构id信息头
    public static final String USER_IDENTITY_HEADER = "x-useridentity-header";			//用户id信息头
    public static final String ACCOUNT_ID_HEADER = "x-account-header";		//用户账号信息头
    public static final String ROLE_HEADER = "x-role-header";				//角色信息头
    public static final String TENANT_ID_HEADER = "x-tenantid-header";		//租户信息头(应用)


    public static final String BASE_ROLE = "ROLE_USER";						//基础角色
    public static final String AUTHORIZATION_CODE = "authorization_code";	//授权码模式
    public static final String PASSWORD = "password";						//密码模式
    
}
